<?php
     class adminupdateModel extends Model{
		 //有关admin管理员信息修改的模型
		 //查询当前用户信息
		 public function select(){
			 session_start();
		     $username=$_SESSION['user'];
			 $sql="SELECT * FROM `admin_login` WHERE username='{$username}'";
			 return $this->db->fetchRow($sql);
		 }
		 //修改admin信息
	     public function update(){
			$id=$_GET['id'];
		    $username=$_POST['username'];
		    $password=$_POST['password'].$_POST['salt'];
			$salt=$_POST['salt'];
		    $sql="UPDATE `admin_login` SET `username`='{$username}',`password`=md5($password),`salt`='{$salt}' WHERE `id`='{$id}'";
		    return $this->db->query($sql);
		}		
	 } 
?>